using B.S.NewMedical.Api.Write.Application.Command.Doctor;
using B.S.NewMedical.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Mvc;

namespace B.S.NewMedical.Api.Write.Controllers.Doctor
{
    [Route("api/doctor/[controller]/[action]")]
    [ApiController]
    public class PrescriptionController : ControllerBase
    {
        private readonly IMediator _mediator;

        public PrescriptionController(IMediator mediator)
        {
            _mediator = mediator;
        }

        /// <summary>
        /// 创建开单申请
        /// </summary>
        /// <param name="command">开单申请命令</param>
        /// <returns>开单申请ID</returns>
        [HttpPost]
        public async Task<ApiResult<int>> CreatePrescription(CreatePrescriptionCommand command)
        {
            return await _mediator.Send(command);
        }
    }
} 